#include <broadcast.h>

namespace Controller {
  
  Broadcast::Broadcast()
    :broadcastType(BROADCAST_TYPE_NULL),
     broadcastAttribute(BROADCAST_ATTRIBUTE_READ_WRITE),
     signal("NULL"),
     boolData(false),
     stringData(" "),
     intData(0),
     doubleData(0.0)
  {
    
  }
  
  Broadcast::~Broadcast()
  {
    
  }

  bool Broadcast::SetAttribute(BroadcastAttribute newBroadcastAttribute)
  {
    broadcastAttribute = newBroadcastAttribute;
    return true;
  }
  
  bool Broadcast::SetBoolData(bool data)
  {
    if( BROADCAST_ATTRIBUTE_READ_WRITE == broadcastAttribute )
      boolData = data;
    else
      return false;
    return true;
  }
  
  bool Broadcast::SetStringData(std::string data)
  {
    if( BROADCAST_ATTRIBUTE_READ_WRITE == broadcastAttribute )
      stringData = data;
    else
      return false;
    return true;
  }
  
  bool Broadcast::SetIntData(int data)
  {
    if( BROADCAST_ATTRIBUTE_READ_WRITE == broadcastAttribute )
      intData = data;
    else
      return false;
  return true;
  }
  
  bool Broadcast::SetDoubleData(double data)
  {
    if( BROADCAST_ATTRIBUTE_READ_WRITE == broadcastAttribute )
      doubleData = data;
    else
      return false;
    return true;
  }

  bool Broadcast::SetBroadcastType(BroadcastType newBroadcastType)
  {
    if( BROADCAST_ATTRIBUTE_READ_WRITE == broadcastAttribute )
      broadcastType = newBroadcastType;
    else 
      return false;
    return true;
  }
  
  bool Broadcast::GetBoolData()
  {
    return boolData;
  }
  
  std::string Broadcast::GetStringData()
  {
    return stringData;
  }
  
  int Broadcast::GetIntData()
  {
    return intData;
  }
  
  double Broadcast::GetDoubleData()
  {
    return doubleData;
  }

}
